package com.yz.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.yz.entity.Charts;
import com.yz.service.StatisticService;

@RestController
public class StatisticController {
	@Autowired
	private StatisticService statisticService;
	
	@RequestMapping("/getStatistic")
	public Object getStatistic(String min,String max) {
		List<Integer> peopleNum = statisticService.getPeopleNum(min, max);
		List<String> readroomName = statisticService.getReadroomName(min, max);
		Charts charts = new Charts();
		charts.setxData(readroomName);
		charts.setyData(peopleNum);
		return charts;
		
	}
}
